﻿using Swashbuckle.AspNetCore.Annotations;
using System;
using System.ComponentModel.DataAnnotations;
using Xms.Abp.BackgroundJob;
using Xms.Abp.Data;

namespace BackgroundJobManagement;

public class BackgroundJobCreateOrUpdateParameterBase : IHasDisplayName, IHasRemark
{
    [Required]
    [MaxLength(128)]
    [SwaggerSchema("显示名称")]
    public string DisplayName { get; set; }

    [SwaggerSchema("参数")]
    public string JobArgs { get; set; }

    [Required]
    [MaxLength(128)]
    [SwaggerSchema("重试间隔")]
    public string RetryIntervals { get; set; }

    [SwaggerSchema("最大执行次数")]
    public short? MaxTryCount { get; set; }

    [SwaggerSchema("错误信息")]
    public string ErrorMessage { get; set; }

    [SwaggerSchema("执行超时时间（ms）")]
    public int? Timeout { get; set; }

    [SwaggerSchema("优先级")]
    public BackgroundJobPriority Priority { get; set; } = BackgroundJobPriority.Normal;

    [SwaggerSchema("备注")]
    public string Remark { get; set; }
}
